package com.bruan.d9_lamda;

import java.sql.SQLOutput;

public class LambdaTest1 {
    public static void main(String[] args) {
        Animal a = new Animal() {
            @Override
            public void run() {
                System.out.println("狗跑得快！");
            }
        };
        a.run();

        //新
        Swimming s = new Swimming() {
            @Override
            public void run() {
                System.out.println("swimming");
            }
        };

        //拉姆达表达式 简化函数式接口的重写过程
        Swimming s1 = () -> {
            System.out.println("重写");
        };
        s1.run();

    }
}

interface Swimming{
    void run();
}

abstract class Animal{
    public abstract void run();
}